package no.eirikb.bomberman.shared.clientcommand;

import no.eirikb.bomberman.shared.Game;
import no.eirikb.bomberman.applet.game.Pos;
import no.eirikb.bomberman.shared.User;

/**
 *
 * @author eirikb
 */
public class StopWalkEvent extends ClientEvent {

    private String nick;
    private Pos lastPos;

    public StopWalkEvent(String nick, Pos lastPos) {
        this.nick = nick;
        this.lastPos = lastPos;
    }

    public void execute(Game game) {
        User user = game.getUsers().get(nick);
        user.setWalking(false);
        user.setLastPos(lastPos);
    }

    public void execute(User user) {
        user.setWalking(false);
        user.setLastPos(lastPos);
    }
}
